Component({
  data: {
    selected: 0,
    color: "#5C626B",
    selectedColor: "#212121",
    list: [
      {
        "pagePath": "/pages/index/index",
        "text": "首页",
        "iconPath": "/assets/images/nav/home.png",
        "selectedIconPath": "/assets/images/nav/home-s.png"
      },
      {
        "pagePath": "/pages/home/home",
        "text": "商场",
        "iconPath": "/assets/images/nav/index.png",
        "selectedIconPath": "/assets/images/nav/index-s.png"
      },
      {
        "pagePath": "/pages/order/order",
        "text": "订单",
        "iconPath": "/assets/images/nav/order.png",
        "selectedIconPath": "/assets/images/nav/order-s.png"
      },
      {
        "pagePath": "/pages/mine/mine",
        "text": "我的",
        "iconPath": "/assets/images/nav/mine.png",
        "selectedIconPath": "/assets/images/nav/mine-s.png"
      }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})
